<?php $this->load->module('mobile/index/header', $common);?>
<div class="content">
    <div id="list">
            <a href="">
                <div class="list-item fn-clear">
                    <div class="info">
                        <h5><?php echo $info['order_title'];?></h5>
                        <div class="i-note">
                            <p class="price">
                                <?php if (!empty($info['order_account'])) :?>
                                    ¥<?php echo $info['order_account'];?>
                                <?php endif; ?>
                            </p>
                            <p class="c_mt">数量：<?php echo $info['order_num'];?></p>
                            <p class="c_mt">订单编号：<?php echo $info['order_sn'];?></p>
                            <p class="c_mt">订单状态：<?php echo $info['order_status_name'];?></p>
                            <p class="c_mt">支付状态：<?php echo $info['pay_status_name'];?></p>
                            <p class="c_mt">出行时间：<?php echo $info['order_date'];?></p>
                            <p class="c_mt">下单时间：<?php echo $info['add_time'];?></p>
                        </div>
                    </div>

                </div>
            </a>
    </div>

    <?php if($user_id){?>
    <div class="col_div">
        <?php if($info['pay_identify']=='1'):?>
        <a href="<?php echo $info['pay_url'];?>" class="btn btn-orange btn_submit" title="立即支付">立即支付</a>
        <?php endif ;?>
        <?php if($info['cancel_identify']=='1'):?>
            <a href="javascript:void(0)" class="btn btn-grey btn_cancel" title="立即取消">取消</a>
        <?php endif ;?>
    </div>
    <?php }?>


</div>
<?php $this->load->module('mobile/index/footer', $common);?>
<script type="text/javascript">
    function alert_popup(text){
        $.dialog({
            style:'tip',
            width:200,
            closeTime:1000,
            content: '<p style="text-align: center">'+text+'</p>'
        }).open();
    }

    var order_id = <?php  echo $info['order_id'];?>  ;
    $(function(){
        var slid = $("#sliderimg").slider({
            loop: true
        });

        $('.btn_cancel').click(function(){
            if(confirm('确定要取消订单吗？')){
                $.post('<?php  echo $info['cancel_url'];?>',{
                    order_id:order_id
                },function(data){
                    alert_popup(data.info);
                    if (data.status == '1') {

                        setTimeout(function(){
                            window.location.reload();
                        }, 1000);
                    }
                },'json')
            }

        })

    });
</script>